<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="/common/include/page.jsp" %>
<!DOCTYPE html>
<html lang="en">
	<head>
		<title>列表 - easyui</title>
		<%@ include file="/common/include/title.jsp" %>

		<script type="text/javascript">
			/* 添加数据 */
			function addData()
			{
				addTabs(window.parent,"管理员添加","insert.html");
				return false ; 
			}
			
			/* 删除数据 */
			function removeData()
			{
				var row = $("#dataGrid").datagrid("getSelected");
				if(row)
				{
					/* 测试数据 */
					var sb = "" ; 
					for(var wangsh in row )
					{
						sb += wangsh + "-->" + row[wangsh] + "\r\n"; 
					}
					alert(sb + '---' + row.title)
					$.messager.confirm("确认","确认要删除吗?",function(data)
					{
						if(data)
						{
							/* 点击确认操作 */
							$.messager.alert("警告框","已经删除")
						}
						return false ; 
					});
				}
				return false ; 
			}
			
			/* 搜索的操作 */
			function query()
			{
				/* 让dagagrid刷新 */
				$("#dataGrid").datagrid("reload",
				{
					"keyword":$("#keyword").val(),
					"status":$("#status").val(),
					"st":$("#st").val(),
					"ed":$("#ed").val()
				});
				return false ; 
			}
		</script>
	</head>
	<body>
		<!-- 测试数据 -->
		<table id="dataGrid" class="easyui-datagrid" title="测试数据"
			data-options="
			<%-- url:'${rootPath }/easyui/datagrid.json', --%>
			url:'${rootPath }/back/users/adminsListJSON.html',
			method:'post',
			border:false,
			singleSelect:true,
			fit:true,
			fitColumn:true,
			collapsible:true,
			rownumbers:true,
			pagination:true,
			toolbar:'#gridToolsbar'">
			<thead>
				<tr>
					<%-- field:指的就是json中字段的键 --%>
					<th data-options="field:'ck',checkbox:true"></th>
					<th data-options="field:'id'" width="">id</th>
					<th data-options="field:'ssoId'" width="80">ssoid</th>
					<th data-options="field:'email'">邮箱</th>
					<th data-options="field:'trueName'" width="100">真实姓名</th>
					<th data-options="field:'statusStr'">状态</th>
					<th data-options="field:'createTime'">创建时间</th>
					<th data-options="field:'updateTime'">更新时间</th>
					<th data-options="field:'lastLoginTime'">上次登陆时间</th>
				</tr>
			</thead>
		</table>
		<!-- 表格的工具栏 -->
		<div id="gridToolsbar">
			<div>
				<input class="easyui-textbox" name="keyword" id="keyword" placeholder="请输入关键字">
				<select class="easyui-combobox" name="status" id="status">
					<option value="">请选择</option>
					<option value="1">启用</option>
					<option value="0">禁用</option>
				</select>
				<input class="easyui-datetimebox" placeholder="请输入起始时间" data-options="" name="st" id="st">
				-->
				<input class="easyui-datetimebox" placeholder="请输入结束时间" data-options="" name="ed" id="ed">
				<a href="" class="easyui-linkbutton" data-options="iconCls:'icon-search'" plain="true" onclick="return query()">搜索</a>
			</div>
			<div>
				<a href="#" class="easyui-linkbutton" title="添加" data-options="iconCls:'icon-add'"  plain="true" onclick="return addData()">添加</a>
				<a href="#" class="easyui-linkbutton" title="更新" data-options="iconCls:'icon-edit'" plain="true" onclick="return addData()">更新</a>
				<a href="#" class="easyui-linkbutton" title="删除" data-options="iconCls:'icon-remove'" plain="true" onclick="return removeData()">删除</a>
			</div>
		</div>
	</body>
</html>